﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace FlexiCommerce.Web.UI.DynamicData
{
    public class AndExpressionParameter : CompositeExpressionParameterBase
    {
        protected override Expression BuildBody(List<LambdaExpression> lambdas)
        {
            Expression root = lambdas[0].Body;
            for (int i = 1; i < lambdas.Count; i++)
            {
                root = Expression.MakeBinary(ExpressionType.And, root, lambdas[i].Body);
            }
            return root;
        }
    }
}
